﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace System.ComponentModel
{

    /// <summary>
    /// This attribute can be placed on a property, parameter or constructor.
    /// When placed on a property or parameter this can be used to mark a dependency
    /// and whether it is optional or not.
    /// When placed on a constructor, it marks the constructor as the one to use
    /// to inject dependencies if the object has more than one constructor.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.Constructor, Inherited = true, AllowMultiple = false)]
    public sealed class DependencyAttribute : Attribute
    {

        private bool _optional;

        /// <summary>
        /// Gets or sets whether the dependency is optional.
        /// </summary>
        public bool Optional
        {
            get
            {
                return _optional;
            }
            set
            {
                _optional = value;
            }
        }
    }
}
